<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;
use app\traits\MyModelTrait;

/**
 * @mixin \think\Model
 */
class AdminRole extends Model
{
    use MyModelTrait;

    // 角色
    protected $table = 'admin_role';

    /**
     * 生成记录
     *
     * @param string $title 标题, unique key
     */
    public static function generateLog(string $title): void
    {
        $insert = [
            'title'         => $title,
            'created_at'    => date('Y-m-d H:i:s'),
            'updated_at'    => date('Y-m-d H:i:s')
        ];
        self::insert($insert);
    }// generateLog() end
}
